package com.puzzlebazar.client.user;

import com.puzzlebazar.client.main.control.MainController;
import com.puzzlebazar.client.main.control.NamedStateSubControllerImpl;
import com.puzzlebazar.client.main.control.SubStateTokenFactory;
import com.puzzlebazar.client.main.view.TabbedView;

public class SettingsController extends NamedStateSubControllerImpl {


	public static final String DEFAULT_STATE_NAME = SettingsGeneralSubstate.STATE_NAME;

	private final SettingsGeneralSubstate generalSubstate;

	/**
	 * Creates a controller for puzzle information pages
	 * 
	 * @param model The associated model
	 * @param view The associated view
	 * @param parentController The parent of this sub controller
	 * @param tokenFactory The object used to build tokens for substates
	 */
	public SettingsController(UserModel model, TabbedView view, MainController parentController, SubStateTokenFactory tokenFactory ) {
		super(parentController, tokenFactory);
		
		generalSubstate = new SettingsGeneralSubstate( model, view, this );
	}

	@Override
	public void gotoDefaultState() {
		if( !leaveCurrentState() ) return;
		enterState( generalSubstate );
	}

	@Override
	public String getDefaultStateName() {
		return DEFAULT_STATE_NAME;
	}
	
	
}
